﻿@*

Notes

http://stackoverflow.com/questions/4929538/c-sharp-mvc3-razor-alternating-items-in-a-foreach-list

http://15daysofjquery.com/table-striping-made-easy/5/

*@


    <link href="@Url.Content("~/Style/Grid/Black/styles.css")" rel="stylesheet" type="text/css" />
    <script src="/Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('.Black_Grid tr:even').addClass('Black_GridHeader');
            $('.Black_Grid tr:odd').addClass('Black_GridAlternatingItem');
            $('.Black_Grid tr').hover(
            function () {
                $(this).addClass("highlight");
            },
             function () {
                 $(this).removeClass("highlight");
             });
        }); 
    </script>

@model IEnumerable<MVCGrid.DAL.Content>
@section featured {
    <section class="featured">

        <div class="Black_Report">
            <p>MVC Grid View</p>
            <p>@Html.ActionLink("Create New", "Create")</p>
            <div>
                <table class="Black_Grid" cellspacing="0" rules="all" border="1" style="width:40%;border-collapse:collapse;">
                    <tbody>
                    <tr>
                    <td>ContentID:</td>
                    <td>PageName:</td>
                    <td>ContentText:</td>
                    <td></td>
                    </tr>
                    </tr>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>
                                @(item.ContentID)
                            </td>
                            <td>
                                @(item.PageName)
                            </td>
                            <td>
                                @(item.ContentText)
                            </td>
                            <td style="width:150px;">
                                @Html.ActionLink("Edit", "Edit", new { ContentID = item.ContentID })
                                @Html.ActionLink("Details", "Details", new { ContentID = item.ContentID })
                                @Html.ActionLink("Delete", "Delete", new { item.ContentID })
                            </td>
                        </tr>
                    }
                    </tbody>
                </table>
            </div>
        </div>
    </section>
}
